# -*- test-case-name: tlpy.test.test_twistd -*-
# Copyright (c) tlpy.
# See LICENSE for details.

"""
The tlpy Daemon: platform-independent interface.

@author: Christopher Armstrong
"""

from tlpy.application import app

from tlpy.python.runtime import platformType
if platformType == "win32":
    from tlpy.scripts._twistw import ServerOptions, \
        WindowsApplicationRunner as _SomeApplicationRunner
else:
    from tlpy.scripts._twistd_unix import ServerOptions, \
        UnixApplicationRunner as _SomeApplicationRunner


def runApp(config):
    _SomeApplicationRunner(config).run()


def run():
    app.run(runApp, ServerOptions)


__all__ = ['run', 'runApp']
